import { Param } from "./types";

export const IsortParamList: Param[] = [
    {
        name: "classes",
        descEn: "An override list of tokens to always recognize as a Class for order-by-type regardless of casing.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#classes",
    },
    {
        name: "combine-as-imports",
        descEn: "Combines as imports on the same line.",
        descCn: "",
        defaultValue: false,
        url: "https://beta.ruff.rs/docs/settings/#combine-as-imports",
    },
    {
        name: "constants",
        descEn: "An override list of tokens to always recognize as a CONSTANT for order-by-type regardless of casing.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#constants",
    },
    {
        name: "extra-standard-library",
        descEn: "A list of modules to consider standard-library, in addition to those known to Ruff in advance.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#extra-standard-library",
    },
    {
        name: "force-single-line",
        descEn: "Forces all from imports to appear on their own line.",
        descCn: "",
        defaultValue: false,
        url: "https://beta.ruff.rs/docs/settings/#force-single-line",
    },
    {
        name: "force-sort-within-sections",
        descEn: "Don't sort straight-style imports (like import sys) before from-style imports (like from itertools import groupby). Instead, sort the imports by module, independent of import style.",
        descCn: "",
        defaultValue: false,
        url: "https://beta.ruff.rs/docs/settings/#force-sort-within-sections",
    },
    {
        name: "force-to-top",
        descEn: "Force specific imports to the top of their appropriate section.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#force-to-top",
    },
    {
        name: "force-wrap-aliases",
        descEn: "Force import from statements with multiple members and at least one alias (e.g., import A as B) to wrap such that every line contains exactly one member.",
        descCn: "",
        defaultValue: false,
        url: "https://beta.ruff.rs/docs/settings/#force-wrap-aliases",
    },
    {
        name: "forced-separate",
        descEn: "A list of modules to separate into auxiliary block(s) of imports, in the order specified.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#forced-separate",
    },
    {
        name: "known-first-party",
        descEn: "A list of modules to consider first-party, regardless of whether they can be identified as such via introspection of the local filesystem.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#known-first-party",
    },
    {
        name: "known-local-folder",
        descEn: "A list of modules to consider being a local folder. Generally, this is reserved for relative imports (from . import module).",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#known-local-folder",
    },
    {
        name: "known-third-party",
        descEn: "A list of modules to consider third-party, regardless of whether they can be identified as such via introspection of the local filesystem.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#known-third-party",
    },
    {
        name: "lines-after-imports",
        descEn: "The number of blank lines to place after imports. Use -1 for automatic determination.",
        descCn: "",
        defaultValue: -1,
        url: "https://beta.ruff.rs/docs/settings/#lines-after-imports",
    },
    {
        name: "lines-between-types",
        descEn: `The number of lines to place between "direct" and import from imports.`,
        descCn: "",
        defaultValue: 0,
        url: "https://beta.ruff.rs/docs/settings/#lines-between-types",
    },
    {
        name: "no-lines-before",
        descEn: "A list of sections that should not be delineated from the previous section via empty lines.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#no-lines-before",
    },
    {
        name: "order-by-type",
        descEn: "Order imports by type, which is determined by case, in addition to alphabetically.",
        descCn: "",
        defaultValue: true,
        url: "https://beta.ruff.rs/docs/settings/#order-by-type",
    },
    {
        name: "relative-imports-order",
        descEn: `Whether to place "closer" imports (fewer . characters, most local) before "further" imports (more . characters, least local), or vice versa.

        The default ("furthest-to-closest") is equivalent to isort's reverse-relative default (reverse-relative = false); setting this to "closest-to-furthest" is equivalent to isort's reverse-relative = true.`,
        descCn: "",
        defaultValue: "furthest-to-closest",
        optionList: ["furthest-to-closest", "closest-to-furthest"],
        url: "https://beta.ruff.rs/docs/settings/#relative-imports-order",
    },
    {
        name: "required-imports",
        descEn: "Add the specified import line to all files.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#required-imports",
    },
    {
        name: "section-order",
        descEn: "Override in which order the sections should be output. Can be used to move custom sections.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#section-order",
    },
    {
        name: "sections",
        descEn: "A list of mappings from section names to modules. By default custom sections are output last, but this can be overridden with section-order.",
        descCn: "",
        defaultValue: {},
        demoValue: { "django": ["django"] },
        url: "https://beta.ruff.rs/docs/settings/#sections",
        validValue: (value: unknown) => {
            if (typeof value != "object") {
                return "配置值必须是对象";
            }
            for (const v of Object.values(value as object)) {
                if (!Array.isArray(v)) {
                    return "对象值必须是字符串数组";
                }
                for (const av of (v as unknown[])) {
                    if (typeof av !== "string") {
                        return "对象值必须是字符串数组";
                    }
                }
            }
            return null;
        },
    },
    {
        name: "single-line-exclusions",
        descEn: "One or more modules to exclude from the single line rule.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#single-line-exclusions",
    },
    {
        name: "split-on-trailing-comma",
        descEn: "If a comma is placed after the last member in a multi-line import, then the imports will never be folded into one line.",
        descCn: "",
        defaultValue: true,
        url: "https://beta.ruff.rs/docs/settings/#split-on-trailing-comma",
    },
    {
        name: "variables",
        descEn: "An override list of tokens to always recognize as a var for order-by-type regardless of casing.",
        descCn: "",
        defaultValue: [],
        url: "https://beta.ruff.rs/docs/settings/#variables",
    },

];